package com.bsoft.gol.hcs.specialist.dao;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import com.bsoft.gol.hcs.specialist.entity.FollowUpRouteDetailFactorRelation;

import java.util.List;

/**
 * @Author: lanyu
 * @Description: 随访路径详情因素类型关联DAO
 * @Date: create in 2022/5/19 16:08
 */
public abstract class FollowUpRouteDetailFactorRelationDAO extends HibernateSupportDelegateDAO<FollowUpRouteDetailFactorRelation> {

    /**
     * 根据路径详情id和路径因素关联信息查询
     * @param routeDetailFactorId
     * @param routeDetailId
     * @return
     */
    @DAOMethod(sql = " from FollowUpRouteDetailFactorRelation where route_detail_factor_id =:routeDetailFactorId and route_detail_id=:routeDetailId")
    public abstract List<FollowUpRouteDetailFactorRelation> queryFactorRelationByRouteDetailFactorId(
            @DAOParam("routeDetailFactorId") Long routeDetailFactorId,
            @DAOParam("routeDetailId") Long routeDetailId);

    /**
     * 根据路径详情id和路径详情因素id删除
     * @param routeDetailId
     * @param routeDetailFactorId
     */
    @DAOMethod(sql = "DELETE from FollowUpRouteDetailFactorRelation where route_detail_id =:routeDetailId and route_detail_factor_id=:routeDetailFactorId")
    public abstract void deleteRouteDetailFactorRelationById(@DAOParam("routeDetailId") Long routeDetailId,@DAOParam("routeDetailFactorId") Long routeDetailFactorId);

    /**
     * 根据路径详情全部删除开始因素关联因素表信息
     * @param routeDetailId
     */
    @DAOMethod(sql = "DELETE from FollowUpRouteDetailFactorRelation where route_detail_id =:routeDetailId ")
    public abstract void deleteFactorRelationByRouteDetailId(@DAOParam("routeDetailId") Long routeDetailId);
}
